package com.gtpickupapp;

import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;


import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;



public class NewEvent extends MapActivity {
	float eSix = 1000000.0f;
	
	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {    
		super.onCreate(savedInstanceState);    
		//setContentView(R.layout.newevent);
		//View v = LayoutInflater.from(this).inflate(R.layout.newevent, null);
		setContentView(R.layout.newevent);
		
		
		
		MapView mapView = (MapView)findViewById(R.id.mapview);
		mapView.setBuiltInZoomControls(true);
		
		
		List<Overlay> mapOverlays = mapView.getOverlays();
		Drawable drawable = this.getResources().getDrawable(R.drawable.mapmarker);
		MapOverlays itemizedOverlay = new MapOverlays(drawable,this, getIntent().getExtras());	
		
		//North Avenue
		String coordinates[] = {"33.769629","-84.391420"};
		double lat = Double.parseDouble(coordinates[0]);
		double lon = Double.parseDouble(coordinates[1]);
		GeoPoint point = new GeoPoint((int)(lat * eSix), (int)(lon * eSix));
		OverlayItem overlayItem = new OverlayItem(point, "North Avenue Field", "North ave quad field!");
		
		//Burger Bowl
		GeoPoint burgerBowl = new GeoPoint((int)(33.777761 * eSix),(int)(-84.403024 * eSix));
		OverlayItem overlayBB = new OverlayItem(burgerBowl,"Burger Bowl", "Field on West Campus");
		
		//crc
		GeoPoint crc = new GeoPoint((int)(33.775473 * eSix),(int)(-84.403147 * eSix));
		OverlayItem overlayCRC = new OverlayItem(crc,"Campus Recreation Center", "Georgia Tech CRC");
		
		//Central Green Space
		GeoPoint centralGreen = new GeoPoint((int)(33.774746 * eSix),(int)(-84.397380 * eSix));
		OverlayItem overlayCG = new OverlayItem(centralGreen,"Center of Campus ", "Georgia Tech Central Green Space");
		
		//Peters parking deck B ball
		GeoPoint petersBBall = new GeoPoint((int)(33.774521 * eSix),(int)(-84.393432 * eSix));
		OverlayItem overlayPetersBBall = new OverlayItem(petersBBall,"Peters Basketball Courts", "Peters B-Ball courts");
		
		//Peters parking Deck tennis courts
		GeoPoint petersTennis = new GeoPoint((int)(33.775221 * eSix),(int)(-84.393682 * eSix));
		OverlayItem overlayPetersTennis = new OverlayItem(petersTennis,"Peters Tennis Courts", "Peters Parking Deck Tennis Courts");
		
		
		
		//freshman Quad
		GeoPoint freshmanQuad = new GeoPoint((int)(33.772983 * eSix),(int)(-84.391335 * eSix));
		OverlayItem overlayFC = new OverlayItem(freshmanQuad,"Freshman Quad Field", "East Camput Freshman Quad Field");
		
		itemizedOverlay.addOverlay(overlayItem);
		itemizedOverlay.addOverlay(overlayBB);
		itemizedOverlay.addOverlay(overlayCRC);
		itemizedOverlay.addOverlay(overlayCG);
		itemizedOverlay.addOverlay(overlayPetersBBall);
		itemizedOverlay.addOverlay(overlayPetersTennis);
		itemizedOverlay.addOverlay(overlayFC);
		
		mapOverlays.add(itemizedOverlay);
		 
		MapController mapCont = mapView.getController();
		
		//Center Of Campus
		GeoPoint centerOfCampus = new GeoPoint((int)(33.776198 * eSix),(int)(-84.396908 * eSix));
		
		mapCont.animateTo(centerOfCampus);
		mapCont.setCenter(centerOfCampus);
		mapCont.setZoom(16);
		
		
		
		
	}

	
}
